package com.eblacorp.archive.security.ldap.service;

import java.util.List;

import javax.naming.InvalidNameException;

import com.eblacorp.archive.security.ldap.dao.ContactDao;
import com.eblacorp.archive.security.ldap.model.Contact;
import com.eblacorp.archive.security.ldap.model.Group;
/**
 * @author Mahmoud.Ezzat
 * 
 */
public class ContactServiceImpl implements ContactService {

	ContactDao contactDao;

	@Override
	public void create(Contact contact) throws InvalidNameException {
		contactDao.create(contact);
	}

	@Override
	public void delete(Contact contact) throws InvalidNameException {
		contactDao.delete(contact);
	}

	@Override
	public List<String> listAllContactsNames() {
		return contactDao.listAllContactsNames();
	}

	@Override
	public List<Contact> searchContact(String searchTerm) {
		return contactDao.searchContact(searchTerm);
	}

	@Override
	public Contact findContactBySAMName(String sAMName) {
		return contactDao.findContactBySAMName(sAMName);
	}

	@Override
	public List<Contact> listContacts() {
		return contactDao.listContacts();
	}

	@Override
	public void addContactToUOGroup(Contact contact, Group group) {
		contactDao.addContactToUOGroup(contact, group);
	}

	@Override
	public void removeContactToUOGroup(Contact contact, Group group) {
		contactDao.removeContactToUOGroup(contact, group);
	}

	public ContactDao getContactDao() {
		return contactDao;
	}

	public void setContactDao(ContactDao contactDao) {
		this.contactDao = contactDao;
	}

}
